﻿using Abp.Domain.Entities;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FutureApp.Shop
{
    /// <summary>
    /// 库存
    /// </summary>
    [Table("GoodsStocks")]
    public class GoodsStock : Entity<Guid>
    {
        /// <summary>
        /// Id
        /// </summary>
        [Key, ForeignKey(nameof(Goods))]
        public override Guid Id { get; set; }

        /// <summary>
        /// 商品
        /// </summary>
        public virtual Goods Goods { get; set; }

        /// <summary>
        /// 库存数量
        /// </summary>
        [Range(0, int.MaxValue)]
        public virtual int Quantity { get; set; }
    }
}
